﻿<mvvm:View x:Class="HelloWorld.Startup.Views.HeaderView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mvvm="clr-namespace:HelloWorld.Startup.MVVM"
             mc:Ignorable="d" x:Name="view"
             d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Border Grid.Row="0" CornerRadius="5" Margin="10,10,10,0">
            <Border.Background>
                <SolidColorBrush Color="White" Opacity="0.4"/>
            </Border.Background>
            <Grid Margin="5" TextBlock.FontSize="15" TextBlock.Foreground="White" TextBlock.FontWeight="Bold">
                <TextBlock Text="Localization Library" HorizontalAlignment="Center"/>
            </Grid>
        </Border>
        <Border Grid.Row="1" CornerRadius="5" Margin="10,10,10,0" TextBlock.Foreground="White">
            <Border.Background>
                <SolidColorBrush Color="White" Opacity="0.1"/>
            </Border.Background>
            <Grid Margin="10,5,10,5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <WrapPanel Grid.Column="0" VerticalAlignment="Center">
                    <TextBlock Text="{Binding ElementName=view, Path=LocalizationModel.CurrentLanguage}"/>
                </WrapPanel>
                <WrapPanel Grid.Column="1">
                    <ComboBox SelectedIndex="0" MinWidth="250"
                              DisplayMemberPath="Description" 
                              SelectedValuePath="Description"
                              ItemsSource="{Binding AvailableLanguages}"
                              SelectedItem="{Binding CurrentLanguage, Mode=TwoWay}"/>
                    <Button Command="{Binding OpenMenuCommand}" Margin="5,0,0,0" Width="150"
                            Content="{Binding ElementName=view, Path=LocalizationModel.GoToHome}" Name="btnMenu"/>
                 </WrapPanel>
            </Grid>
        </Border>
        <Border Grid.Row="2" CornerRadius="5" Margin="10,10,10,0" TextBlock.Foreground="White">
            <Border.Background>
                <SolidColorBrush Color="White" Opacity="0.1"/>
            </Border.Background>
            <TextBlock Text="{Binding ElementName=view, Path=LocalizationModel.StaticResourceNotice}" TextWrapping="Wrap" Margin="10,5,10,5"/>
        </Border>
    </Grid>
</mvvm:View>
